<?php
/**
 * Class:   Controller
 * About:   Класс-предок контроллеров
 * Author:  Vlad Andreev <php.vlad@gmail.com>
 **/

namespace Control;

class ControllerAncestor
{
    protected $conf;
    protected $em;
    protected $data = array();
    protected $_use_theme = false;
    
    public function __construct()
    {
        $this->conf = Core::conf();
        $this->em   = Core::em();
    }
    
    protected function statusOk() {
        
        return '{"status":"200"}';
    }
    
    protected function statusForbidden($msg) {
        return '{"status":"403","message":"'. $msg .'"}';
    }
    
    protected function statusError(/*$code,*/ $msg) {
        // http_response_code($code);
        // header('HTTP/1.1 '. $code .' '. $msg );
        
        return '{"status":"500","message":"'. $msg .'"}';
    }
}